import Vue from 'vue'
import Router from 'vue-router'
import Login from './views/Login.vue'
import Home from './views/Home.vue'
import Chat from './views/chat/Chat.vue'
import HrInfo from './views/HrInfo.vue'

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login,
      hidden: true
    }, {
      path: '/home',
      name: 'Home',
      component: Home,
      hidden: true,
      meta: {
        roles: ['admin', 'user']
      },
      children: [
        {
          path: '/hrInfo',
          name: '个人中心',
          component: HrInfo,
          hidden: true
        },
        {
          path: '/chat',
          name: '在线聊天',
          component: Chat,
          hidden: true
        }
      ]
    }, {
      path: '*',
      redirect: '/home'
    }
  ]
})
